﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.Shared.Dto.Wx.MiniProgram
{
    /// <summary>
    /// 调用auth.code2Session 接口返回信息
    /// https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html
    /// </summary>
    public class Code2SessionDto
    {
        [JsonProperty(PropertyName = "openid")]
        public string OpenId { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "session_key")]
        public string SessionKey { get; set; } = string.Empty;

        /// <summary>
        /// 用户在开放平台的唯一标识符，若当前小程序已绑定到微信开放平台帐号下会返回，详见 UnionID 机制说明。
        /// </summary>
        [JsonProperty(PropertyName = "unionid")]
        public string UnionId { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "errcode")]
        public int? ErrorCode { get; set; } = null;

        [JsonProperty(PropertyName = "errmsg")]
        public string ErrorMsg { get; set; } = string.Empty;

    }
}
